import time

from selenium import webdriver

# 获取浏览器驱动对象
browser = webdriver.Chrome('E:\浏览器插件（chrome）/chromedriver.exe')

# 打开指定URL
browser.get('http://news.baidu.com/')

# 定位搜索框,输入ddd
ret = browser.find_element_by_id('ww').send_keys('ddd')
# ret = browser.find_element_by_css_selector('#ww')  # 查询id为ww
# ret = browser.find_element_by_css_selector('.word')  # 查询class为word
# ret = browser.find_element_by_xpath("//input[@class='word']")
print(ret)

time.sleep(3)

browser.quit()
